
% check_input_files
% Christopher J. Whalen
% University of Illinois
% 06/30/04 - First Created
% 06/07/05 - Last Modified

% Purpose - to check that all necessary input files are present in the
%           correct directory

function check_input_files(file,choice)

% Checking for Input Files
fprintf('\nChecking Prerequisite Files...');
fprintf('\n*************************************************************');

% BRIK - Determining what folder the BRIK is in (New Fiducial Method vs. Old Fiducial Method)
fid=fopen(file.brik);
if fid == -1
    fprintf('\nBRIK  File: NOT Found    %s\n',file.brik);
else
    fprintf('\nBRIK  File: Found        %s\n',file.brik);
end

% TAI
fid=fopen(file.tai);
if fid == -1
    fprintf('TAI   File: NOT Found    %s\n',file.tai);
else
    fprintf('TAI   File: Found        %s\n',file.tai);
end

% ELP
fid=fopen(file.elp);
if fid == -1
    fprintf('ELP   File: NOT Found     %s\n',file.elp);
else
    fprintf('ELP   File: Found        %s\n',file.elp);
end

% MTG 
fid=fopen(file.mtg);
if fid == -1
    fprintf('MTG   File: NOT Found    %s\n',file.mtg);
else
    fprintf('MTG   File: Found        %s\n',file.mtg);
end

% SCALP File
fid=fopen(file.scalp_zip);
if fid == -1
    fprintf('SCALP File: NOT Found    %s\n',file.scalp_zip);
else
    fprintf('SCALP File: Found        %s\n',file.scalp_zip);
end

% HSP
if choice.mode == 2
    fid=fopen(file.hsp);
    if fid == -1
        fprintf('HSP   File: NOT Found    %s\n',file.hsp);
    else
        fprintf('HSP   File: Found        %s\n',file.hsp);
    end
end

% % BRIK mriT
% if fid == -1
%     fid=fopen(brik_fileT);
%     if fid == -1
%         fprintf(['\nBRIK File: NOT Found     ' brik_file '\n']);
%     else
%         brik_file = brik_fileT;
%         tai_file = tai_fileT;
%         brik_out_file = brik_out_fileT;
%         fprintf(['\nBRIK File: Found         ' brik_file '\n']);
%     end
% end

% % SRC
% fid=fopen(src_file);
% if fid == -1
%     fprintf('SRC File NOT Found\n');
% else
%     fprintf('SRC File Found\n');
% end
% 
% % DET
% fid=fopen(det_file);
% if fid == -1
%     fprintf('DET File NOT Found\n');
% else
%     fprintf('DET File Found\n');
% end

fprintf('*************************************************************\n');
% fprintf('File Check Complete\n');
